﻿namespace Example.Xml
{
    using System.Xml;
    using Xunit;

    public class XmlDocumentFacts
    {
        [Fact]
        public void op_SelectSingleNode()
        {
            var xml = new XmlDocument();
            xml.LoadXml(
                "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" +
                "<foo>" +
                "<bar name=\"value\"/>" +
                "</foo>");

            var node = xml.SelectSingleNode("/foo/bar/@name");
            if (null == node)
            {
                Assert.NotNull(node);
            }
            else
            {
                Assert.Equal("value", node.Value);
            }
        }
    }
}